package com.briup.ch07;



/**
 * @Author briup-adam
 * @Date 2023/10/11 下午3:31
 * @Description
 **/

public class StringTest {
    public static void main(String[] args) {
        String s1 = new String();
        String s2 = new String("");
        String s3 = "";
        System.out.println(s1==s2);//false
        System.out.println(s2==s3);//false
        System.out.println(s1==s3);//false
        char [] c={'h','e','l','l','o'};
        String s4 = new String(c);
        System.out.println(s4);
        String s5="Hello";
        String s6="Hello";
        System.out.println(s5==s6);//true
        String s7=new String("Hello");
        System.out.println(s6==s7);//false
        String s8 = s7.intern();
        System.out.println(s8==s6);//true
        System.out.println(s8==s7);//false
        String s9="Hel"+"lo";
        System.out.println(s9==s8);//true
        String s10="Hel";
        String s11=s10+"lo";
        System.out.println(s11);
        System.out.println(s11==s9);//false



    }
}
